<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="txt1"><br/><br/>
<textarea name="" id="txt2" cols="30" rows="10"></textarea>

<script>
   var txt1 = document.getElementById('txt1');
   var txt2 = document.getElementById('txt2');

   txt1.onkeydown = function (ev) {
       var oEvent = ev||event;

       if (oEvent.keyCode == 13){
           txt2.value += txt1.value+'\n';
           txt1.value = '';
       }

   }

</script>
</body>
</html>